package com.hc.serviceimp;

import java.util.List;

import com.hc.dao.ContractDao;
import com.hc.daoimp.ContractDaoImpl;
import com.hc.entity.Contract;
import com.hc.entity.House;
import com.hc.entity.Tenant;
import com.hc.service.ContractService;

public class ContractServiceImpl implements ContractService {
	//调用dao层方法的对象
	ContractDao cDao = new ContractDaoImpl();
	
	
	@Override
	public List<Contract> select(String cname, String cdate, String cstate) {
		List<Contract> contracts = cDao.select(cname, cdate, cstate);
		
		return contracts;
	}


	@Override
	public Contract toupdate(int id) {
		Contract contract = cDao.toupdate(id);
		return contract;
	}


	@Override
	public List<Tenant> getallteant() {
		List<Tenant> tenants = cDao.getallteant();
		return tenants;
	}


	@Override
	public List<House> getallhouse() {
		List<House> houses = cDao.getallhouse();
		return houses;
	}


	@Override
	public void update(Contract contract) {
		cDao.update(contract);
		
	}


	@Override
	public void add(Contract contract) {
		cDao.add(contract);
		
	}

}
